import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;

/**
 * Created by hui_stone on 2017/9/10 0010.
 */
public class Consumer implements Runnable {

    //    private final  BlockingDeque<String> blockingDeque;
    private final BlockingQueue<String> sharedQueue;

    public Consumer(BlockingQueue<String> sharedQueue) {
        this.sharedQueue = sharedQueue;
    }

    @Override
    public void run() {
        while (true) {
            try {
                String something = sharedQueue.take();
                System.out.println("======== " + something + " ============");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
